import { createRouter, createWebHistory } from 'vue-router';

const router = createRouter({
    history: createWebHistory(),
    routes: [
        {
            path: '/',
            // name: 'login',
            component: () => import('../view/login.vue')
        },
        {
            path: '/dashboard',
            // name: 'dashboard',
            component: () => import('../view/dashboard.vue'),
            // meta: { requiresAuth: true }
            children:[
                {
                    
                    path: 'user',//这里不需要加斜杠，因为父级已经加过了
                    // name: 'user',
                    component: () => import('../view/UserView.vue')
                },
                {
                    path: 'user/:id',
                    name: 'userDetail',
                    component: () => import('../view/userDetail.vue')
                },
                {
                    path: 'activity',
                    // name: '/activity',
                    component: () => import('../view/activityView.vue')
                },
                {
                    path: 'activity/add',
                    name: 'activityDetail',
                    component: () => import('../view/activityDetail.vue')
                },
                {
                    path: 'activity/:id',
                    name: 'activityDetailView',
                    component: () => import('../view/activityDetailView.vue')
                },
                {
                    path: '/dashboard/clue',
                    name: 'clue',
                    component: () => import('../view/clueView.vue')
                },
                {
                    path: '/dashboard/clue/add',
                    name: 'clueDetail',
                    component: () => import('../view/ClueItemView.vue')
                },
                {
                    path: '/dashboard/clue/edit/:id',
                    name: 'clueeditView',
                    component: () => import('../view/ClueDetailView.vue')
                },{
                    path: '/dashboard/clue/detail/:id',
                    name: 'clueDetailView',
                    component: () => import('../view/ClueDetailView.vue')
                },{
                    path: '/dashboard/customer',
                    name: 'customerView',
                    component: () => import('../view/CustomerView.vue')
                }
            ]
        },
       
    ]
});

export default router;